<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
       <h1>你的成绩评价</h1>
       <test-result :score="60"></test-result>
       <test-result :score="96"></test-result>
       
    </div>
    
    <script>
        Vue.component('test-result',{
            props:['score'],
            template:`
                <div>
                {{score}}分，{{testResult}}
                </div>
            `,
            computed:{
                testResult(){
                    var strRsult = "";
                    if(this.score<60)
                    strRsul="不及格";
                    else if(this.score<90)
                    strRsul="中等生";
                    else if(this.score<=100);
                    strRsul="优秀生";
                    return strRsult
                }
            }
        })
        var vm = new Vue({
            el:'#app',
            data:{},
            methods:{}
        })
       
    </script>
</body>
</html>